package com.xc.freeapp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.xc.freeapp.common.Verification;
import com.xc.freeapp.dao.HospitalSchedulingMapper;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.HospitalScheduling;

@Service
public class HospitalSchedulingService {
	@Autowired
	HospitalSchedulingMapper hospitalSchedulingMapper;

	@Transactional(propagation = Propagation.REQUIRED, readOnly = true, rollbackFor = Exception.class)
	public List<HospitalScheduling> selectByHospitalid(Integer hospitalid) {
		DBContextHolder.switchDataSourceRW();// 切换数据源
		Map<String,Object>   maps=Verification.convertWeekByDate();
		maps.put("hospitalid", hospitalid);
		return hospitalSchedulingMapper.selectByHospitalid(maps);
	}

}
